package com.jsrj.controller;

import com.alipay.api.AlipayApiException;
import com.jsrj.common.core.controller.BaseController;
import com.jsrj.common.core.domain.AjaxResult;
import com.jsrj.service.IAlipayService;
import jdk.nashorn.internal.parser.JSONParser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
*@auther 崔宏江
*@describe 服务商模板构建支付宝小程序
*@data 2024/7/2 16:29
*/
@RestController
@RequestMapping("/system/alipay")
public class AlipayController extends BaseController {
    @Autowired
    private IAlipayService alipayService;

    @GetMapping("/upload-miniversion")
    public AjaxResult uploadMiniVersion() throws AlipayApiException {
        return alipayService.uploadMiniVersion();
    }

    @GetMapping("/query-miniversion")
    public AjaxResult queryMiniVersion() throws AlipayApiException {
        return alipayService.queryMiniVersion();
    }

    @GetMapping("/query-detail-miniversion")
    public AjaxResult queryDetailMiniVersion() throws AlipayApiException {
        return alipayService.queryDetailMiniVersion();
    }

    @GetMapping("/query-base-miniinfo")
    public AjaxResult queryMiniBaseInfo() throws AlipayApiException {
        return alipayService.queryMiniBaseInfo();
    }

    @GetMapping("/query-minicategory")
    public AjaxResult queryMiniCategory() throws AlipayApiException {
        return alipayService.queryMiniCategory();
    }

    @GetMapping("/query-minicategory-require")
    public AjaxResult queryMiniCategoryRequire(Long id) throws AlipayApiException {
        return alipayService.queryMiniCategoryRequire(id);
    }

    @GetMapping("/audit-miniversion")
    public AjaxResult auditMiniVersion(Long id) throws AlipayApiException {
        return alipayService.auditMiniVersion(id);
    }

    @GetMapping("/audited-miniversion")
    public AjaxResult auditedMiniVersion(Long id) throws AlipayApiException {
        return alipayService.auditedMiniVersion(id);
    }
}
